document.ready(function(){
     //初始化参数
     CanvasParticle({
        vx: 4,	//小球x轴速度,正为右，负为左
        vy: 4,	//小球y轴速度
        height: 2,	//小球高宽，其实为正方形，所以不宜太大
        width: 2,
        count: 600,		//点个数
        // color: "121, 162, 185", 	//点颜色
        color: "200,193,193", 	//点颜色
        // stroke: "130,255,255", 		//线条颜色
        // stroke: "240,250,228", 		//线条颜色
        stroke: "0,0,0", 		//线条颜色
        dist: 6000, 	//点吸附距离
        e_dist: 20000, 	//鼠标吸附加速距离
        max_conn: 10 	//点到点最大连接数
   });

     /**
   * 0.获取元素
   */
  let financialUl = document.querySelector('.financial .case-text')
  let businessUl = document.querySelector('.business .case-text')
  let governmentUl = document.querySelector('.government .case-text')
  let floor = document.querySelector('.right')
  let floorP = document.querySelectorAll('.right li')
  let floorBox = document.querySelectorAll('.left .lun')

  /**
   * 4.需求: 判断窗口滚动距离,当滚动距离>=444, floor改变为固定定位, 否则就是绝对定位
   */
   window.addEventListener('scroll', function (){
      //获取滚动距离
      let sTop = document.documentElement.scrollTop
      if( sTop >= 444 ){
        floor.style.position = 'fixed'
        floor.style.top = '10px';
      }else{
        floor.style.position = 'absolute'
        floor.style.top = '444px';
      }
    })
  
    /**
     * 5.需求: 点击电梯,滚动到指定楼层
     */
    floorP.forEach(function (dom, i){
      dom.addEventListener('click', function (){
        //找到当前楼层距离网页顶部距离
        let top = floorBox[i].offsetTop;

        buffer(document.documentElement,{scrollTop:top-10})
    
  
      })
    })



})